package com.globallogic.university;

import javax.management.remote.SubjectDelegationPermission;
import java.util.Date;

/**
 *  Class unites to a single object: Subject, Teacher, Group.
 */
public class Lesson {
//    private Auditorium room;
//    private String typeLesson;
    private Subject subject;
    private StudentsGroup group;
    private Teacher teacher;

    public Lesson(Subject subject, Teacher teacher, StudentsGroup group){
        if (subject != null) {
            this.subject = subject;
        } else {
            throw new NullParameterException("Parameter 'subject' is NULL!");
        }

        if (teacher != null) {
            this.teacher = teacher;
        } else {
            throw new NullParameterException("Parameter 'teacher' is NULL!");
        }

        if (group != null ) {
            this.group = group;
        } else {
            throw new NullParameterException("Parameter 'group' is NULL!");
        }
    }

    public Subject getSubject() {
        return this.subject;
    }

	public String getTeacherName() {
		return this.teacher.getFullName();
	}

    public void setTeacher(Teacher teacher) {
        if (teacher != null) {
            this.teacher = teacher;
        } else {
            throw new NullParameterException("Parameter 'teacher' is NULL!");
        }
    }

    public String getSubjectName() {
        return this.subject.getName();
    }
}